package com.buffered.exam;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author げっしょく
 * @date 2021/8/1
 */
public class Demo4 {
    public static void main(String[] args) {
        FileReader fre1 = null;
        FileWriter cc1 = null;

        try {
            fre1 = new FileReader("Day12/count.txt");
            cc1 = new FileWriter("D:\\IdeaProjects\\BasicCode\\Day12/copycode.txt");
            char[] chars = new char[4];
                int len = 0;
                while ((len = fre1.read(chars)) != -1){
                    cc1.write(chars);
            }
                cc1.flush();

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }/*finally {
            try {
                fre1.close();
                cc1.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }*/

    }
}
